package com.wswy.wzcx.widget;

import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v4.view.NestedScrollingChild;
import android.support.v4.view.NestedScrollingChild2;
import android.support.v7.widget.LinearLayoutCompat;
import android.util.AttributeSet;
import android.util.Log;

public class TopLinearLayout extends LinearLayoutCompat implements NestedScrollingChild,NestedScrollingChild2 {

  private static final String TAG = "TopLinearLayout";

  public TopLinearLayout(Context context) {
    this(context,null);
  }

  public TopLinearLayout(Context context, AttributeSet attrs) {
    this(context, attrs,0);
  }

  public TopLinearLayout(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
  }


  @Override
  public boolean startNestedScroll(int axes) {
    Log.e(TAG, "startNestedScroll --> "+axes);
    return super.startNestedScroll(axes);
  }

  @Override
  public void stopNestedScroll() {
    super.stopNestedScroll();
  }

  @Override
  public boolean dispatchNestedPreFling(float velocityX, float velocityY) {
    return super.dispatchNestedPreFling(velocityX, velocityY);
  }

  @Override
  public boolean dispatchNestedScroll(int dxConsumed, int dyConsumed, int dxUnconsumed,
      int dyUnconsumed, @Nullable int[] offsetInWindow) {
    return super
        .dispatchNestedScroll(dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, offsetInWindow);
  }

  @Override
  public boolean startNestedScroll(int axes, int type) {
    Log.e(TAG, "startNestedScroll --> ");
    return false;
  }

  @Override
  public void stopNestedScroll(int type) {

  }

  @Override
  public boolean hasNestedScrollingParent(int type) {
    return false;
  }

  @Override
  public boolean dispatchNestedScroll(int dxConsumed, int dyConsumed, int dxUnconsumed,
      int dyUnconsumed, @Nullable int[] offsetInWindow, int type) {
    return false;
  }

  @Override
  public boolean dispatchNestedPreScroll(int dx, int dy, @Nullable int[] consumed,
      @Nullable int[] offsetInWindow, int type) {
    return false;
  }
}
